package org.gary.base.service.impl;

import java.util.List;

import org.gary.base.model.Online;
import org.gary.base.service.OnlineService;
import org.gary.core.factories.impl.BasicServiceFactoryImpl;
import org.gary.core.util.ResultMessage;
import org.springframework.stereotype.Component;
/**
 * QQ在线服务列表实现类
 * @author Gary
 *
 */
@Component("onlineService")
public class OnlineServiceImpl extends BasicServiceFactoryImpl<Online> implements OnlineService {

	@Override
	public String save(Online entity) {
		// 在在线服务保存之前记录一条日志
		getLoggerService().makeLog(entity.getClass().getName(),
				"开始保存一个在线服务" + entity);
		getBasicDaoFactory().save(entity);
		// 在在线服务保存之后记录一条日志
		getLoggerService().makeLog(entity.getClass().getName(),
				"保存一个在线服务成功" + entity);
		return ResultMessage.link.ADD_SUCCESS;
	}
	
	@Override
	public List<Online> getOnline() {		
		return list(Online.class);
	}
}
